package API.Collection.Set.Traversal;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class IteratorAPI {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        for(int i = 1; i <= 10; i++){
            set.add(i);
        }
        Iterator<Integer> iterator = set.iterator();
        while(iterator.hasNext()) {
            System.out.print(iterator.next() + " ");
        }
    }
}
